Monday 14 January 1985

C Program Execution Structure


Compiler is convert source code into object code.

Compiler also check the source code for the syntax,structure for errors if the source code is error-free the it is generate the object code.


The Compilation process can be divided into four steps.
1. Pre-processing
2. Compiling
3. Assembling
4. Linking

1. Pre-processor
The Source code with extension .c is first pass to the pre-processor and pre-processor expands the code and then this code is passed to the compile.

2. Compile
The code that expanded by pre-processor is passed to the compiler and compiler convert this code to assembly code.

3. Assembler
The assembly code is converted to object code by assembler. 
Name of object file is same as source code file if source code file is test.c then object file is test.obj.

4. Linker
Linker is used to combine the object code library files with the object code of program.
Linker is generate executable file.(.exe)
Output file name is same as source file name but extension is different.










Share This
Previous Post
Next Post

0 Comments: